package g;

import c.b.a.a.a;
import java.io.IOException;
import java.net.Socket;
import java.net.SocketTimeoutException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.annotation.Nullable;

/* compiled from: Okio */
public final class r extends c {
    public final /* synthetic */ Socket k;

    public r(Socket socket) {
        this.k = socket;
    }

    public IOException l(@Nullable IOException iOException) {
        SocketTimeoutException socketTimeoutException = new SocketTimeoutException("timeout");
        if (iOException != null) {
            socketTimeoutException.initCause(iOException);
        }
        return socketTimeoutException;
    }

    public void m() {
        Logger logger;
        Level level;
        StringBuilder g;
        String str = "Failed to close timed out socket ";
        try {
            this.k.close();
        } catch (Exception e) {
            logger = q.a;
            level = Level.WARNING;
            g = a.g(str);
            g.append(this.k);
            logger.log(level, g.toString(), e);
        } catch (AssertionError e2) {
            if (q.a(e2)) {
                logger = q.a;
                level = Level.WARNING;
                g = a.g(str);
                g.append(this.k);
                logger.log(level, g.toString(), e2);
                return;
            }
            throw e2;
        }
    }
}
